<include file="public@header" />
<style>
	html{background-color: #fff}
</style>
</head>
<body>
<form method="post" class="layui-form js-ajax-form" action="{:url('menu/editPost')}"  style="padding: 20px 30px 0 0;">
	<div class="layui-tab-content">
		<div class="layui-form-item">
			<label for="input-parent_id" class="layui-form-label"><span class="form-required">*</span>上级</label>
			<div class="layui-input-block">
				<select class="layui-input" name="parent_id" id="input-parent_id">
					<option value="0">作为一级菜单</option>{$select_category}
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-name" class="layui-form-label"><span class="form-required">*</span>名称</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="input-name" name="name" value="{$data.name}">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-app" class="layui-form-label"><span class="form-required">*</span>应用</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="input-app" name="app" value="{$data.app}">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-controller" class="layui-form-label"><span class="form-required">*</span>控制器</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="input-controller" name="controller" value="{$data.controller}">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-action" class="layui-form-label"><span class="form-required">*</span>方法</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="input-action" name="action" value="{$data.action}">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-param" class="layui-form-label">参数</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input" id="input-param" name="param" value="{$data.param}">
			</div>
			<div class="layui-form-mid layui-word-aux">例:id=3&amp;p=3</div>
		</div>
		<div class="layui-form-item">
			<label for="input-icon" class="layui-form-label">图标</label>
			<div class="layui-input-inline" style="width: 100px">
				<input type="text" class="layui-input" id="input-icon"  lay-filter="iconFonts" name="icon" value="{$data.icon}">
			</div>
			<div class="layui-form-mid layui-word-aux">请下拉选择图标</div>
		</div>
		<div class="layui-form-item">
			<label for="input-remark" class="layui-form-label">备注</label>
			<div class="layui-input-block">
				<textarea class="layui-textarea" id="input-remark" name="remark">{$data.remark}</textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-status" class="layui-form-label">状态</label>
			<div class="layui-input-inline" id="input-status">
				<select class="layui-input" name="status">
					<option value="1">在左侧菜单显示</option>
					<php>$status_selected=empty($data['status'])?"selected":"";</php>
					<option value="0" {$status_selected}>在左侧菜单隐藏</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label for="input-type" class="layui-form-label">类型</label>
			<div class="layui-input-inline">
				<select class="layui-input" name="type" id="input-type">
					<option value="1">有界面可访问菜单</option>
					<php>$type2_selected=$data['type']==2?"selected":"";</php>
					<option value="2" {$type2_selected}>无界面可访问菜单</option>
					<php>$type_selected=$data['type']==0?"selected":"";</php>
					<option value="0" {$type_selected}>只作为菜单</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<input type="hidden" name="id" value="{$data.id}" />
				<button type="submit" class="layui-btn js-ajax-submit js-close" id="js-ajax-submit">{:lang('SAVE')}</button>
			</div>
		</div>
	</div>
</form>
<include file="public@script"/>
<script>
    layui.config({
        base: '__TMPL__/public/layuiadmin/layui/'  // 配置你下载的iconFonts文件夹路径
    }).extend({
        IconFonts: 'iconFonts/iconFonts',
    });
    layui.use(['element','form', 'jquery', 'IconFonts'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var IconFonts=layui.IconFonts;

        //图标选择器
        IconFonts.render({
            // 选择器，推荐使用input
            elem: '#input-icon', //选择器ID
            // 数据类型：fontClass/layui_icon，
            type: 'layui_icon',
            // 是否开启搜索：true/false
            search: true,
            // 是否开启分页
            page: true,
            // 每页显示数量，默认12
            limit: 12,
            // 点击回调
            click: function (data) {
                //console.log(data);
            }
        });
        /**
         * 默认选选中图标
         */
        IconFonts.checkIcon("iconFonts","{$data.icon}","layui_icon");
    });
</script>
</body>
</html>